package com.kuang.demo.controller;

import com.kuang.demo.bean.BaseRespVo;
import com.kuang.demo.bean.acgBeanVo.StatGoodsData;
import com.kuang.demo.bean.acgBeanVo.StatOrderData;
import com.kuang.demo.bean.acgBeanVo.StatUserData;
import com.kuang.demo.service.StatisticalReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ACG
 * @date 2020-11-03 16:50
 */
@RestController
@RequestMapping("admin/stat")
public class StatisticalReportController {
    //http://182.92.235.201:8083/admin/stat/user
    @Autowired
    StatisticalReportService statisticalReportService;
    @RequestMapping("/user")
    public BaseRespVo StatUserControl(){
        StatUserData data =  statisticalReportService.StatUserControl();
      return  BaseRespVo.ok(data);
    }

    //http://182.92.235.201:8083/admin/stat/order
    @RequestMapping("/order")
    public BaseRespVo StatOrderControl(){

        StatOrderData statOrderData = statisticalReportService.StatOrderControl();

        return BaseRespVo.ok(statOrderData);
    }

    ///admin/stat/goods
    @RequestMapping("/goods")
    public BaseRespVo StatGoodsControl(){
        StatGoodsData statGoodsData = statisticalReportService.StatGoodsControl();
        return BaseRespVo.ok(statGoodsData);
    }
}
